<template>
	<view class="status-wrap"> 
		<view class="status flex flex-column align-center">
			<text class="iconfont">&#xe65d;</text>
			<text class="status-text">提交成功，等待审批</text>
		</view>
		
		<view class="submit">
			<button @click="goDetail">查看订单详情</button>
			<button @click="back">继续下单</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: ''
			};
		},
		onLoad(options) {
			this.id = options.id
			this.form_type = options.form_type
		},
		methods:{
			goDetail() {
				uni.$emit('again')
				if (this.form_type == 1) {
					uni.navigateTo({
						url: '/pages/detail/detail?orderId='+this.id + '&type=statusToDetail'
					})
				} else {
					uni.navigateTo({
						url: '/pages/detail/detail?orderId='+this.id
					})
				}
			},
			back() {
				uni.$emit('again')
				let delta = 2;
				if (this.form_type == 1) {
					delta = 3
				}
				uni.navigateBack({delta: delta})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.status-wrap{
		flex: 1;
		width: 100%;
		height: 100%;
		display: flex;
		align-items: center;
		flex-direction: column;
		
		.status{
			padding: 60rpx 0;
			
			.iconfont{
				color: green;
				font-size: 128rpx;
			}
			
			.status-text{
				font-size: 28rpx;
				font-weight: bold;
				padding-top: 24rpx;
			}
		}
		
		
		.submit{
			width: 80%;
			padding-top: 180rpx;
			
			button{
				width: 100%;
				color: #FFFFFF;
				font-size: 32rpx;
				margin-top: 42rpx;
				border-radius: 8rpx;
				background-color: var(--primary-color);
				
				&:last-child{
					color: var(--primary-color);
					background-color: #FFFFFF;
					border: 1px solid var(--primary-color);
				}
			}
		}
	}
</style>
